import axios from 'axios'

// const instance=axios.create({
//     baseURL:'http://some-demain.com/api',
//     timeout:1000,
//     headers:{'X-Custom-Header':'foobar'}
// })

axios.interceptors.request.use(function (config) {
    return {
        ...config,
        timeout: 5000,
        Authorization: {
            headers: localStorage.getItem('token')
        }
    };
}, function (error) {
    return Promise.reject(error)
})
axios.interceptors.response.use(function (response) {
    return response;
}, function (error) {
    return Promise.reject(error)
})
export default axios